<template>
  <div class="app-container">
    <h1>权限列表</h1>
    <el-table :data="allPerms">
      <el-table-column prop="id" label="编号" width="180" />
      <el-table-column prop="name" label="权限名" width="180" />
      <el-table-column prop="link" label="路由" width="180" />
      <el-table-column prop="layer" label="层级" width="180" />
      <el-table-column label="操作">
        <el-button
          class="mgr"
          type="primary"
          icon="el-icon-edit"
          circle
          @click="update(scope.row)"
        />
        <el-popconfirm
          title="是否要删除此用户?"
          confirm-button-text="确定"
          cancel-button-text="取消"
          @confirm="del(scope.row, scope.$index, roleList)"
        >
          <template #reference>
            <el-button type="danger" icon="el-icon-delete" circle />
          </template>
        </el-popconfirm>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
import { getAllPerms } from '@/api/rbac'
export default {
  data() {
    return {
      allPerms: []
    }
  },
  created() {
    getAllPerms().then(res => {
      this.allPerms = res.data
    })
  },
  methods: {
    update(data) {
    },
    del(role, index, rows) {

    }
  }
}
</script>
<style>
.mgr {
    margin-right: 10px;
}
</style>

